<!-- 附近店铺组件 -->
<template>
	<div class="list">
		<h3 class="list_title">附近店铺</h3>
		<router-link :to="`/shop/${item.id}`" v-for="(item, index) in list" :key="item.id">
			<ShopInfo :item="item" />
		</router-link>
	</div>
</template>

<script>
import _axios from '@/api/axios.js';
import { ref, onMounted } from 'vue';
import ShopInfo from '@/components/ShopInfo'
export default {
	name: 'Nearby',
	setup () {
		const list = ref([]);
		const getHotList = () => {
			var data = { a: 1 }
			_axios.get('api/getHotList', data).then(res => {
				list.value = res.data;
			}).catch(err => {
				console.log(err);
			});
		};
		onMounted(() => {
			getHotList();
		})
		return { list };
	},
	components: { ShopInfo }
};
</script>

<style lang="scss" scoped>
.list {
	.list_title {
		margin: 0.16rem 0 0.02rem;
		font-size: 0.18rem;
		color: #333;
		font-weight: normal;
	}
}
</style>
